#include <vector>
using namespace std;

template <typename HashedObj>
class HashTable
{
public:
	explicit HashTable(int size=101);
	bool contains(const HashedObj& x) const;
	bool remove(const HashedObj& x);
	bool insert(const HashedObj& x);
	void makeEmpty();
	
	enum EntryType{ACTIVE, EMPTY, DELETED};
private:
	struct HashEntry{
		HashedObj element;
		EntryType info;
		
		HashEntry(const HashedObj& e= HashedObj(), EntryType i= EMPTY)
			:element(e), info(i) {}
			
	};
	vector<HashEntry> array;
	int current_size;
	
	bool isActive(int currentPos) const
	{
		return array[currentPos].info==ACTIVE;
	}
	int findPos(const HashedObj & x) const;
	void rehash();
	int myhash(const HashedObj &x ) const;
};



